import Vue from 'vue'
import Router from 'vue-router'
import outsell from '@/components/outsell'
import orderVal from '../compon/orderVal.vue'
import searchVal from '../compon/searchVal.vue'
import myVal from '../compon/myVal.vue'
import allCity from "../components/allCity.vue"
import searchCity from "../components/searchCity.vue"
import searchCityVal from '../components/searchCityVal.vue'
import searchHistory from "../components/searchHistory.vue"
import login from "../components/login.vue"
import modifyPass from "../components/modifyPass.vue"
import peopleCenter from "../components/peopleCenter.vue"
import balance from "../components/balance"
import detail from "../components/detail.vue"
import info from "../components/info.vue"
import userV from "../components/userV.vue"
import modifyAdress from "../components/modifyAdress.vue"
import add_Adress from "../components/add_Adress.vue"
import searchAdress from "../components/searchAdress.vue"
import home from "../components/home.vue"
import storeDetail from "../components/storeDetail.vue"
import daijinjuan from "../components/daijinjuan.vue"
import hongbaoSm from "../components/hongbaoSm.vue"
import djjSm from "../components/djjSm.vue"
import historyHB from "../components/historyHB.vue"
import dhHb from "../components/dhHb.vue"
import tjyj from "../components/tjyj.vue"
import elmApp from "../components/elmApp.vue"
import integral from "../components/integral.vue"
import jfsm from "../components/jfsm.vue"
import vipCenter from "../components/vipCenter.vue"
import vipSm from "../components/vipSm.vue"
import payment from "../components/payment.vue"
import exchangeVip from "../components/exchangeVip.vue"
import serverCenter from "../components/serverCenter.vue"
import serverContent from "../components/serverContent.vue"
Vue.use(Router)
const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  routes: [{
      path: '/',
      name: 'allCity',
      component: allCity,
      meta: {
        deep: 2
      }
    },
    {
      path: "/login",
      name: "login",
      component: login,
      meta: {
        deep: 2
      }
    },
    {
      path: '/allCity',
      name: 'allCity',
      component: allCity,
      meta: {
        deep: 2
      }
    },
    {
      path: '/orderVal',
      name: 'orderVal',
      component: orderVal,
      meta: {
        deep: 1
      }
    }, {
      path: '/outsell',
      name: 'outsell',
      component: outsell,
      meta: {
        deep: 1
      }
    }, {
      path: '/searchVal',
      name: 'searchVal',
      component: searchVal,
      meta: {
        deep: 1
      }
    }, {
      path: '/myVal',
      name: 'myVal',
      component: myVal,
      meta: {
        deep: 1
      }
    },
    {
      path: '/searchCity',
      name: 'searchCity',
      component: searchCity,
      children: [{
        path: '/searchCityVal',
        name: 'searchCityVal',
        component: searchCityVal
      }, {
        path: '/searchHistory',
        name: 'searchHistory',
        component: searchHistory
      }],
      meta: {
        deep: 2
      }
    },
    {
      path: "/modifyPass",
      name: "modifyPass",
      component: modifyPass,
      meta: {
        deep: 2
      }
    },
    {
      path: "/peopleCenter",
      name: "peopleCenter",
      component: peopleCenter,
      meta: {
        deep: 1
      }
    },
    {
      path: "/balance",
      name: "balance",
      component: balance,
      meta: {
        deep: 2
      }
    }, {
      path: "/detail",
      name: "detail",
      component: detail,
      meta: {
        deep: 2
      }
    }, {
      path: "/info",
      name: "info",
      component: info,
      meta: {
        deep: 2
      }
    }, {
      path: "/userV",
      name: "userV",
      component: userV,
      meta: {
        deep: 2
      }
    }, {
      path: "/modifyAdress",
      name: "modifyAdress",
      component: modifyAdress,
      mete: {
        deep: 2
      }
    }, {
      path: "/add_Adress",
      name: "add_Adress",
      component: add_Adress,
      meta: {
        deep: 2
      }
    }, {
      path: "/searchAdress",
      name: "searchAdress",
      component: searchAdress,
      meta: {
        deep: 2
      }
    },
    // 首页商家
    {
      path: "/home",
      name: "home",
      component: home,

    },
    {
      path: "/storeDetail",
      name: "storeDetail",
      component: storeDetail,

    },
    {
      path: "/daijinjuan",
      name: "daijinjuan",
      component: daijinjuan,
      children: [{
        path: '/hongbaoSm',
        name: 'hongbaoSm',
        component: hongbaoSm
      }, {
        path: '/djjSm',
        name: 'djjSm',
        component: djjSm
      }, {
        path: '/historyHB',
        name: 'historyHB',
        component: historyHB
      }, {
        path: '/dhHb',
        name: 'dhHb',
        component: dhHb
      }, {
        path: "/tjyj",
        name: "tjyj",
        component: tjyj
      }, {
        path: "/elmApp",
        name: "elmApp",
        component: elmApp
      }],
    }, {
      path: "/integral",
      name: "integral",
      component: integral,
      children: [{
        path: "/jfsm",
        name: "jfsm",
        component: jfsm
      }]
    }, {
      path: "/vipCenter",
      name: "vipCenter",
      component: vipCenter,
      children: [{
        path: '/vipSm',
        name: 'vipSm',
        component: vipSm
      }, {
        path: '/payment',
        name: 'payment',
        component: payment
      }, {
        path: "/exchangeVip",
        name: 'exchangeVip',
        component: exchangeVip
      }]
    }, {
      path: "/serverCenter",
      name: 'serverCenter',
      component: serverCenter
    },{
      path:"/serverContent",
      name:"serverContent",
      component:serverContent
    }
  ]
})
